#include "../include/Enemy.hh"
#include "../include/Skill.hh"
#include <iostream>

Enemy::Enemy(const std::string& name) : Character(name, "Normal Enemy") {
    attributes.health = 200;
    maxHealth = 200;
    attributes.attack = 20;
    attributes.defense = 10;
    attributes.speed = 10;
    attributes.armor = 5;
    attributes.penetration = 5;
    attributes.damageMultiplier = 1.0f;
    attributes.critChance = 10;
    attributes.critDamage = 50;
    isStunned = false;
    addSkill(create(SkillType::NormalAttack));
}

void Enemy::displayInfo() const {
    std::cout << "Enemy: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

Ghost::Ghost(const std::string& name) : Enemy(name) {
    description = "Ghost Enemy";
    attributes.health = 160;
    maxHealth = 160;
    attributes.attack = 30;
    attributes.defense = 5;
    attributes.speed = 20;
    attributes.armor = 3;
    attributes.penetration = 8;
    attributes.damageMultiplier = 1.0f;
    attributes.critChance = 10;
    attributes.critDamage = 50;
    skills.clear();
    addSkill(create(SkillType::FireBall));
}

void Ghost::displayInfo() const {
    std::cout << "Ghost: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

Boss::Boss(const std::string& name) : Enemy(name) {
    description = "Boss Enemy";
    attributes.health = 200;
    maxHealth = 200;
    attributes.attack = 30;
    attributes.defense = 15;
    attributes.speed = 8;
    attributes.armor = 10;
    attributes.penetration = 10;
    attributes.damageMultiplier = 1.2f;
    attributes.critChance = 15;
    attributes.critDamage = 60;
    skills.clear();
    addSkill(create(SkillType::DevastatingStrike));
}

void Boss::displayInfo() const {
    std::cout << "Boss: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

EliteBoss::EliteBoss(const std::string& name) : Enemy(name) {
    description = "Elite Boss Enemy";
    attributes.health = 400;
    maxHealth = 400;
    attributes.attack = 35;
    attributes.defense = 12;
    attributes.speed = 10;
    attributes.armor = 15;
    attributes.penetration = 12;
    attributes.damageMultiplier = 1.1f;
    attributes.critChance = 12;
    attributes.critDamage = 55;
    skills.clear();
    addSkill(create(SkillType::ThunderStrike));
}

void EliteBoss::displayInfo() const {
    std::cout << "Elite Boss: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

SuperBoss::SuperBoss(const std::string& name) : Enemy(name) {
    description = "Super Boss Enemy";
    attributes.health = 600;
    maxHealth = 600;
    attributes.attack = 40;
    attributes.defense = 15;
    attributes.speed = 14;
    attributes.armor = 18;
    attributes.penetration = 10;
    attributes.damageMultiplier = 0.4f;
    attributes.critChance = 20;
    attributes.critDamage = 70;
    isStunned = false;
    skills.clear();
    addSkill(create(SkillType::FireBall));
    addSkill(create(SkillType::Heal));
    addSkill(create(SkillType::DevastatingStrike));
    addSkill(create(SkillType::ThunderStrike));
    addSkill(create(SkillType::ShadowBurst));
}

void SuperBoss::displayInfo() const {
    std::cout << "Super Boss: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

ArmoredWarrior::ArmoredWarrior(const std::string& name) : Enemy(name) {
    description = "Armored Warrior, with high armor and defense";
    attributes.health = 300;
    maxHealth = 300;
    attributes.attack = 70;
    attributes.defense = 50;
    attributes.speed = 8;
    attributes.armor = 30;
    attributes.penetration = 5;
    attributes.damageMultiplier = 1.0f;
    attributes.critChance = 5;
    attributes.critDamage = 40;
    skills.clear();
    addSkill(create(SkillType::NormalAttack));
    addSkill(create(SkillType::IronShield));
}

void ArmoredWarrior::displayInfo() const {
    std::cout << "Armored Warrior: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

GoldenDevil::GoldenDevil(const std::string& name) : Enemy(name) {
    description = "Golden Devil, excels at critical attacks";
    attributes.health = 200;
    maxHealth = 200;
    attributes.attack = 90;
    attributes.defense = 10;
    attributes.speed = 30;
    attributes.armor = 5;
    attributes.penetration = 30;
    attributes.damageMultiplier = 1.5f;
    attributes.critChance = 50;
    attributes.critDamage = 80;
    skills.clear();
    addSkill(create(SkillType::BloodAttack));
    addSkill(create(SkillType::GoldenStrike));
}

void GoldenDevil::displayInfo() const {
    std::cout << "Golden Devil: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

Cyborg::Cyborg(const std::string& name) : Enemy(name) {
    description = "Mechanically enhanced warrior, excels at energy attacks";
    attributes.health = 800;
    maxHealth = 800;
    attributes.attack = 200;
    attributes.defense = 40;
    attributes.speed = 35;
    attributes.armor = 50;
    attributes.penetration = 20;
    attributes.damageMultiplier = 1.5f;
    attributes.critChance = 50;
    attributes.critDamage = 100;
    skills.clear();
    addSkill(create(SkillType::ThunderStrike));
    addSkill(create(SkillType::OverloadPulse));
}

void Cyborg::displayInfo() const {
    std::cout << "Cyborg: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

ExplosiveWarrior::ExplosiveWarrior(const std::string& name) : Enemy(name) {
    description = "Warrior specializing in explosive attacks";
    attributes.health = 1000;
    maxHealth = 1000;
    attributes.attack = 150;
    attributes.defense = 45;
    attributes.speed = 30;
    attributes.armor = 70;
    attributes.penetration = 70;
    attributes.damageMultiplier = 1.5f;
    attributes.critChance = 50;
    attributes.critDamage = 90;
    skills.clear();
    addSkill(create(SkillType::NormalAttack));
    addSkill(create(SkillType::ExplosiveBlast));
}

void ExplosiveWarrior::displayInfo() const {
    std::cout << "Explosive Warrior: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

SuperIdol::SuperIdol(const std::string& name) : Enemy(name) {
    description = "Super Idol, with healing and area attack capabilities";
    attributes.health = 1500;
    maxHealth = 1500;
    attributes.attack = 130;
    attributes.defense = 25;
    attributes.speed = 25;
    attributes.armor = 30;
    attributes.penetration = 20;
    attributes.damageMultiplier = 1.5f;
    attributes.critChance = 30;
    attributes.critDamage = 50;
    skills.clear();
    addSkill(create(SkillType::JuiceSplash));
    addSkill(create(SkillType::HealSuper));
    addSkill(create(SkillType::ThunderStrike));
}

void SuperIdol::displayInfo() const {
    std::cout << "Super Idol: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}

DemonKing::DemonKing(const std::string& name) : Enemy(name) {
    description = "Demon King, with powerful attack and control abilities";
    attributes.health = 10000;
    maxHealth = 10000;
    attributes.attack = 10000;
    attributes.defense = 200;
    attributes.speed = 1000;
    attributes.armor = 100;
    attributes.penetration = 100;
    attributes.damageMultiplier = 2.0f;
    attributes.critChance = 100;
    attributes.critDamage = 300;
    skills.clear();
    addSkill(create(SkillType::HellfireStorm));
    addSkill(create(SkillType::ShadowBurst));
    addSkill(create(SkillType::BloodAttack));
    addSkill(create(SkillType::DevastatingStrike));
}

void DemonKing::displayInfo() const {
    std::cout << "Demon King: " << name << "\n";
    std::cout << "Description: " << description << "\n";
    std::cout << "Attributes:\n";
    std::cout << "  Health: " << attributes.health << "/" << maxHealth << "\n";
    std::cout << "  Attack: " << attributes.attack << "\n";
    std::cout << "  Defense: " << attributes.defense << "\n";
    std::cout << "  Speed: " << attributes.speed << "\n";
    std::cout << "  Armor: " << attributes.armor << "\n";
    std::cout << "  Penetration: " << attributes.penetration << "\n";
    std::cout << "  Critical Chance: " << attributes.critChance << "%\n";
    std::cout << "  Critical Damage: " << attributes.critDamage << "%\n";
    std::cout << "  Damage Multiplier: " << attributes.damageMultiplier << "x\n";
    if (!skills.empty()) {
        std::cout << "Skills:\n";
        for (const auto& skill : skills) {
            std::cout << "  - " << skill.name << ": " << skill.description << "\n";
        }
    }
}